package day01;

import java.util.Stack;

public class Solution01 {
	Stack<Integer> stack1 = new Stack<Integer>();
	Stack<Integer> stack2 = new Stack<Integer>();

	public void push(int node) {
		this.stack1.push(node);
	}

	public int pop() {
		if (this.stack2.isEmpty()) {
			while (!this.stack1.isEmpty()) {
				this.stack2.push(this.stack1.pop());
			}
		}
		return this.stack2.pop();
	}

	public static void main(String[] args) {

		Solution01 solution01 = new Solution01();
		solution01.push(0);
		solution01.push(1);
		System.out.println(solution01.pop());
		solution01.push(2);
		solution01.push(3);
		System.out.println(solution01.pop());

	}
}
